home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / system / pc_dcl.zip / HELP / STRASS.HTX < prev    next >
Text File  |  1991-10-15  |  5KB  |  139 lines

  1. :=
  2.  
  3.  :=
  4.  
  5.     Defines a symbolic name for a character string value.
  6.  
  7.     Format:
  8.  
  9.        symbol-name :=[=] string
  10.  
  11.  
  12.     Additional information :
  13.  
  14.        Symbol-name :=.symbol-name     String :=.string      Examples :=.examples
  15.  
  16. :=.symbol-name
  17.  
  18.  :=
  19.  
  20.      symbol-name
  21.  
  22.       Defines a 1- through 32-character string name for the symbol.    The
  23.       symbol  name  must begin with an alphabetic character (uppercase and
  24.       lowercase characters are equivalent), an  underscore,  or  a  dollar
  25.       sign.    After  the  first  character,  the  name  can  contain  any
  26.       alphanumeric characters
  27.  
  28.       If you specify a single equal sign (:=) in the assignment statement,
  29.       the  symbol name is placed in the local symbol table for the current
  30.       command level.
  31.  
  32.       If you specify double equal signs (:==) in the assignment statement,
  33.       the symbol name is placed in the global symbol table.
  34.  
  35. :=.string
  36.  
  37.  :=
  38.  
  39.      string
  40.  
  41.       Specifies a character string value to be equated to the symbol.  The
  42.       string can contain any alphanumeric or special characters. µDCL uses
  43.       a buffer that is  1024  bytes  long  to  hold  a  string  assignment
  44.       statement.   Therefore,  the  length of the symbol name, the string,
  45.       and any symbol substitution within the  string  cannot  exceed  1024
  46.       characters.
  47.  
  48.       With the := string assignment statement, you do not need to  enclose
  49.       a   string   literal   in   quotation   marks.   String  values  are
  50.       automatically  converted  to  uppercase.   Also,  any  leading   and
  51.       trailing  spaces  and tabs are removed, and multiple spaces and tabs
  52.       between characters are compressed to a single space.
  53.  
  54.       Note that, in general, it is easier to use the assignment  statement
  55.       (=)  to create symbols with string values.  The assignment statement
  56.       does not automatically convert letters to uppercase and remove extra
  57.       spaces.  Also, the assignment statement allows you to perform string
  58.       operations in expressions.
  59.  
  60.  
  61.       If you want to prohibit uppercase  conversion  and  retain  required
  62.       space and tab characters in a string, you must place quotation marks
  63.       around the string.  To use quotation marks in a string, enclose  the
  64.       entire  string  in quotation marks and use a double set of quotation
  65.       marks within the string.  For example:
  66.  
  67.            $ TEST := "this     is a ""test"" string"
  68.            $ SHOW SYMBOL TEST
  69.              TEST = "this     is a "test" string"
  70.  
  71.       In this example, the spaces, lowercase letters, and quotation  marks
  72.       are preserved in the symbol definition.
  73.  
  74.       To assign a null string to a  symbol  using  the  string  assignment
  75.       statement, do not specify a string.  For example:
  76.  
  77.            $ NULL :=
  78.  
  79.       Specify the string as a string literal, or as a  symbol  or  lexical
  80.       function which evaluates to a string literal.  If you use symbols or
  81.       lexical functions, place apostrophes around them to  request  symbol
  82.       substitution.
  83.  
  84.  
  85.       You can also use the string assignment statement to define a foreign
  86.       command.  See the VMS DCL Concepts Manual for more information about
  87.       foreign commands.
  88. :=.examples
  89.  
  90.  :=
  91.  
  92.    Examples
  93.  
  94.       1.   $ TIME := SHOW TIME
  95.            $ TIME
  96.              15-OCT-1987 11:55:44
  97.  
  98.       The symbol TIME is equated to the command string SHOW TIME.  Because
  99.       the  symbol  name appears as the first word in a command string, the
  100.       command interpreter automatically substitutes  it  with  its  string
  101.       value and executes the command SHOW TIME.
  102.  
  103.  
  104.  
  105.       2. $ STAT := $DBA1:[CRAMER]STAT
  106.            $ STAT
  107.  
  108.       This example shows how to define STAT as  a  foreign  command.   The
  109.       symbol  STAT  is  equated to a string that begins with a dollar sign
  110.       followed by a file specification.  The command  interpreter  assumes
  111.       that the file specification is that of an executable image, that is,
  112.       a file with a file type of EXE.   Thus,  the  symbol  STAT  in  this
  113.       example becomes a synonym for the command:
  114.  
  115.       $ RUN DBA1:[CRAMER]STAT.EXE
  116.  
  117.       When you subsequently type STAT, the  command  interpreter  executes
  118.       the image.
  119.  
  120.  
  121.  
  122.       3. $ A = "this is a big     space."
  123.            $ SHOW SYMBOL A
  124.              A = "this is a big     space."
  125.            $ B := 'A'
  126.            $ SHOW SYMBOL B
  127.              B = "THIS IS A BIG SPACE."
  128.  
  129.       This example compares  the  assignment  and  the  string  assignment
  130.       statements.  The symbol A is defined using the assignment statement,
  131.       so lowercase letters and multiple spaces are retained.  The symbol B
  132.       is  defined  using  the  string assignment statement.  Note that the
  133.       apostrophes are required; otherwise, the symbol name  B  would  have
  134.       been  equated  to  the  literal  string A.  However, when symbol A's
  135.       value is  assigned  to  symbol  B,  the  letters  are  converted  to
  136.       uppercase and multiple spaces are compressed.
  137.  
  138. 
  139.